home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / TIFF Code.cpt / td.h < prev    next >
Text File  |  1987-12-03  |  2KB  |  104 lines

  1. /* Specifics for non-library modules */
  2.  
  3. #ifndef    _TD
  4.  
  5. /*
  6.  * Types
  7.  */
  8.  
  9. typedef    String(63)    Str63;
  10. typedef union {
  11.     Int16    s;
  12.     Int32    l;
  13. } Int16or32;
  14. typedef Int16or32    *Int16or32Ptr;
  15. typedef Int16        *Int16Ptr;
  16. typedef Int32        *Int32Ptr;
  17. typedef char        *asciiPtr;
  18.  
  19. /* image description type - "id".
  20.  *
  21.  * The structure consists of all known tags at a certain revision of the
  22.  * TIFF specification.  If the size number of items are predetermined by
  23.  * the specification and consist of a reasonably small data item, then they
  24.  * are given space in the structure directly.  If the number of items or
  25.  * the size of the item is unknown, then a pointer to the type is allocated
  26.  * in the structure and it will be necessary to allocate the necessary
  27.  * memory for the tag value or values. */
  28.  
  29. typedef struct {
  30.     Int16            subfileType,        /* 1 SHORT */
  31.                     imageWidth,
  32.                     imageLength;
  33.     Int16Ptr        bitsPerSample,        /* ? SHORTS */
  34.                     compression;
  35.     Int16            photoInterp,        /* 1 SHORT */
  36.                     threshholding,
  37.                     cellWidth,
  38.                     cellLength,
  39.                     fillOrder;
  40.     asciiPtr        docName,            /* ASCII */
  41.                     imageDescription,
  42.                     make,
  43.                     model;
  44.     Int16or32Ptr    stripOffsets;        /* ? SHORTS or LONGS */
  45.     Int16            orientation,        /* 1 SHORT */
  46.                     samplesPerPixel;
  47.     Int32            rowsPerStrip;        /* 1 SHORT or 1 LONG */
  48.     Int32            stripsPerImage;        /* not a tag */
  49.     Int16or32Ptr    stripByteCounts;    /* ? LONGS */
  50.     Int16Ptr        minSampleValue,        /* ? SHORTS */
  51.                     maxSampleValue;
  52.     Rational        xResolution,        /* 1 RATIONAL */
  53.                     yResolution;
  54.     Int16            planarConfig;        /* 1 SHORT */
  55.     asciiPtr        pageName;            /* ASCII */
  56.     Rational        xPosition,            /* 1 Rationals */
  57.                     yPosition;
  58.     Int32Ptr        freeOffsets,
  59.                     freeByteCounts;
  60.     Int16            grayResponseUnit;    /* 1 SHORT */
  61.     Int16Ptr        grayResponseCurve;
  62.     Int32            group3Options,        /* 1 LONG */
  63.                     group4Options;
  64.     Int16            resolutionUnit;        /* 1 SHORT */
  65.     Int16            pageNumber[2];        /* 2 SHORTS */
  66.     Int16            colorResponseUnit;    /* 1 SHORT */
  67.     Int16Ptr        colorResponseCurves;/* ? SHORTS */
  68. } id;
  69.  
  70. /*
  71.  * Macros
  72.  */
  73.  
  74. /* Return minimum of two values */
  75. #define    MIN(a, b)    ((a) < (b) ? (a) : (b))
  76. #define    MAX(a, b)    ((a) > (b) ? (a) : (b))
  77.  
  78. /* Static String Declaration Macro */
  79. #define StatString(name, string)\
  80.         struct {\
  81.             unsigned char length;\
  82.             unsigned char text[sizeof(string)];\
  83.         } name = {\
  84.             sizeof(string) - 1,\
  85.             string\
  86.         }
  87.     
  88. /*
  89.  * Constant Defines
  90.  */
  91.  
  92. /*
  93.  * Debug specific
  94.  */
  95.  
  96. #ifdef DEBUG
  97. void DebugMessage();
  98. #define    DBG(x)    x
  99. #else
  100. #define    DBG(x)
  101. #endif
  102.  
  103. #define _TD
  104. #endif